package xyz.chenyongpeng.orderconsumerdubbo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xyz.chenyongpeng.orderconsumerdubbo.service.ResourceCategoryService;
import xyz.chenyongpeng.orderconsumerdubbo.vo.ResourceCategoryVo;
import xyz.chenyongpeng.utils.R;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("ResourceCategory")
public class ResourceCategoryController {

    @Autowired
    private ResourceCategoryService resourceCategoryService;
    /**
     * 门票，卫生间，停车场等分类
     * @return
     */
    @PostMapping("/get")
    public R get(){
        Map<String,Object> result = new HashMap<>();
        List<ResourceCategoryVo> list = resourceCategoryService.getAll();
        result.put("data", list);
        return R.ok(result);
    }
}
